package com.gainloop.Api;

public class ApiException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2214571730609692137L;
	
	int _code = 0;
	
	public ApiException()
	{
		super();
	}
	
	public ApiException(String msg)
	{
		super(msg);
	}
	
	public ApiException(String msg, int code)
	{
		super(msg);
		
		_code = code;
	}
	
	public ApiException(String msg, ApiResponse res)
	{
		super(msg + res.getError());
		
		_code = res.getReturnCode();
	}
	
	public ApiException(ApiResponse res)
	{
		super(res.getError());
		
		_code = res.getReturnCode();
	}
	
	public int getCode() 
	{
		return _code;
	}

}
